package com.haierCamera.customapplication.ui.user.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

import com.haierCamera.customapplication.BaseFragment;
import com.haierCamera.customapplication.R;
import com.haierCamera.customapplication.databinding.HzklFragmentUserNotLoginBinding;
import com.haierCamera.customapplication.ui.WebViewPublicActivity;
import com.haierCamera.customapplication.ui.login.HZKLLoginActivity;
import com.haierCamera.customapplication.ui.login.HZKLLoginWelcomeActivity;
import com.haierCamera.customapplication.ui.user.activity.HZKLUserAboutActivity;
import com.haierCamera.customapplication.ui.user.activity.HZKLUserFeedBackActivity;
import com.haierCamera.customapplication.utils.android.HttpErrorProcess;

import javax.inject.Inject;

import dagger.Lazy;

public class HZKLUserNotFragment extends BaseFragment {

    //    @Inject
//    ViewModelProvider.Factory factory;
    @Inject
    Lazy<HttpErrorProcess> httpErrorProcessLazy;

    HzklFragmentUserNotLoginBinding binding;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(inflater, R.layout.hzkl_fragment_user_not_login, container, false);
        initData();
        return binding.getRoot();
    }

    private void initData() {
        binding.notLogin.setOnClickListener(view -> startActivity(new Intent(getActivity(), HZKLLoginWelcomeActivity.class)));
        binding.icon.setOnClickListener(view -> startActivity(new Intent(getActivity(), HZKLLoginWelcomeActivity.class)));
        binding.layoutHelpFeedback.setOnClickListener(view -> startActivity(new Intent(getActivity(), HZKLUserFeedBackActivity.class)));
//        binding.layoutAgreement.setOnClickListener(view -> startActivity(new Intent(getActivity(), HZKLUserAboutActivity.class)));

        binding.layoutAgreement.setOnClickListener(view -> startActivity(new Intent(getActivity(), WebViewPublicActivity.class)
                .putExtra("title", "隐私政策").putExtra("url", "http://edu-wc.nullehome.com/servicePotocol/#/")
        ));
    }
}
